                            <? $frmtime = time(); ?>
                            <div class="main">
                                <h3 class="title"><?=$clabel?> &raquo; <?=$mlabel?></h3>
                                <div class="formdiv">
                                    <form method="POST" id="frmEditRoute<?=$frmtime?>">
                                        <table>
                                            <? if( isset($errors) ) {
                                               foreach($errors as $error) {
                                               ?>
                                            <tr>
                                                <td class="errormsg" colspan="3">
                                                    <?=$error?>    
                                                </td>
                                            </tr>   
                                               <? 
                                               } 
                                            }  ?>
                                            <? if( isset($successes) ) {
                                               foreach($successes as $success) {
                                               ?>
                                            <tr>
                                                <td class="successmsg" colspan="3">
                                                    <?=$success?>    
                                                </td>
                                            </tr>   
                                               <? 
                                               } 
                                            }  ?>
                                            <tr>
                                                <td><label for="route_name">Route Name</label></td>
                                                <td>
                                                    <?=$route_name?>
                                                </td>
                                                <td></td>
                                            </tr>
                                            <tr>
                                                <td><label for="route_area">Areas Covered</label></td>
                                                <td>
                                                        <?
                                                            if(isset($arealist) && is_array($arealist) && count($arealist) > 0) {
                                                                $area_key_list = key_index_list($arealist,'area_id');
                                                                if(isset($route_area) && is_array($route_area)) { 
                                                                    $selected_areas = $route_area;
                                                                    $i = 1;
                                                                    foreach($selected_areas as $selected_area) {
                                                                        $area_name = $area_key_list[$selected_area]['area_name'];    
                                                                ?>
                                                                        <?=$i?>. <?=$area_name?><br />
                                                                <?
                                                                        $i++;
                                                                    }
                                                                }
                            	                               
                                                            }
                                                        ?>
                                                </td>
                                                <td></td>
                                            </tr>
                                        	<tr>
                                        		<td></td>
                                        		<td colspan="2">
                                                    <input type="hidden" name="route_id" value="<?=$route_id?>"/>
                                                    <input class="button" type="submit" name="btnEditRoute" value="Edit" id="btnEditRoute" />
                                                </td>
                                        	</tr>
                                        </table>
                                	</form>
                                    <script language="javascript" type="text/javascript">
                                        if(typeof jQuery == 'undefined') {
                                            alert('Invalid Request');
                                            window.location = "/";
                                        }
                                        $(document).ready( function() {
                                            $("#frmEditRoute<?=$frmtime?>").validate({
                                                errorPlacement: function(error, element) {
                                                    placeError(error, element);
                                                },
                                                submitHandler: function(form) {
                                                    var cui = $('#contenttabs .ui-tabs-panel:visible');                                                                                                        
                                               	    var jqxhr = $.post(
                                                        "/transport/EditRoute", 
                                                        $("#frmEditRoute<?=$frmtime?>").serialize(), 
                                                        function (data) {
                                                            $(cui).html(data);
                                                        }
                                                    );
                                                    $(cui).html('<div id="loadingdiv"><div class="centerdiv"><strong>Processing</strong><br/><img src="/images/ajaxloader.gif" /></div></div>');
                                                }
                                            });
                                        });
                                    </script>
                                 </div>
                            </div>